<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>故障诊断报告</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="../css/main.min.css">
    <script src="../js/main.min.js"></script>
    <script src="node-tree-view.js"></script>
    <script src="../base/core.js"></script>
    <style>
        #reportDiv .table>tbody>tr>td,#reportDiv .table>tbody>tr>th,#reportDiv .table>tfoot>tr>td,#reportDiv .table>tfoot>tr>th,#reportDiv .table>thead>tr>td,#reportDiv .table>thead>tr>th{
            vertical-align: middle;
            text-align: center;
            display: table-cell;
        }

        #reportDiv table,#reportDiv table tr th,#reportDiv table tr td {
            border:1px solid #000;
        }

        #reportDiv .table{
            margin-bottom: 2px;
        }

        #content{
            width:195mm;
            height:262mm;
            /*border: 1px solid #000;*/
            text-align: center;
            float: none;
            display: block;
            margin-left: auto;
            margin-right: auto
        }

        .bg-red{
            background-color: red;
        }

        .bg-orange{
            background-color: coral;
        }

        .bg-normal{
            background-color: coral;
        }

        .A4Size{
            width: 175mm;
            height: 262mm;
            border: solid 1px;
        }
    </style>
</head>
<body ng-app="myApp" ng-controller="reportController" >
<!--故障诊断-->
<div id="reportDiv" class="container-fluid">
    <div class="row">
        <div id="content" class="text-center">
            <div class="container-fluid">
                <div class="row">
                    <h1 class="text-center">哈三电厂3号机组故障诊断报告</h1>
                </div>
                <div class="row" style="margin-top: 5% ">
                    <div class="col-md-6">&nbsp;&nbsp;&nbsp;</div>
                    <div class="col-md-6" >
                        <p ng-if="sequence!=null" style="float: right;width: 16em;" class="text-justify">编号：{{sequence}} </p>
                        <p style="float: right;width: 16em;" class="text-justify">时间：{{getNow() | date:'yyyy年MM月dd日 HH:mm:ss'}}  </p>
                    </div>
                </div>
                <div class="row text-left">
                    <h3>1、故障现象 </h3>
                    <table class="table">
                        <thead><tr><th width="30%">故障名称</th>
                            <!--<th width="25%">故障现象</th>-->
                            <th width="20%">故障部位 </th>
                            <!--<th width="15%">故障状态 </th>-->
                            <th width="10%">故障等级 </th>
                            <!--<th width="30%">故障描述</th>-->
                            <!--<th width="10%">选择 </th></tr>-->
                            <th width="10%">持续时间 </th>
                        </thead>
                        <tbody>
                        <tr>
                            <td>{{fault.name}}</td>
                            <td>{{fault.location}}</td>
                            <td><div style="width: 50%;margin-left: 25%;" ng-class='{"紧急停机":"bg-red","监视运行":"bg-orange","正常运行":"bg-normal"}[fault.suggest]'>&nbsp;&nbsp;</div></td>
                            <td>{{last_timestamp<10?"首次发生":(timestamp - last_timestamp | toTimeSpan)}}</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="row text-left">
                    <h3>2、数据特征 </h3>
                    <table class="table">
                        <thead><tr><th width="10%">ID</th><th width="20%">测点名称</th><th width="20%">测点值 </th></tr></thead>
                        <tbody>
                        <tr ng-repeat="r in channels track by $index">
                            <td>{{$index+1}}</td>
                            <td>{{r.name}} </td>
                            <td>{{r.value |startX:2}}</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="row text-left">
                    <h3>3、故障原因 </h3>
                    <table class="table">
                        <thead><tr><th width="10%">序号</th><th width="20%">故障原因 </th><th width="20%">置信度</th></tr></thead>
                        <tbody>
                        <tr ng-repeat="r in reasons | orderBy:'-probability' track by $index">
                            <td>{{$index +1 }}</td>
                            <td>{{r.name}} </td>
                            <td>{{(r.probability*100).toFixed(0)}}%</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="row text-left">
                    <h3>4、处理措施  </h3>
                    <table class="table">
                        <thead><tr><th width="22%">故障原因 </th><th width="38%">相应处理措施</th><th width="20%">所需工具 </th><th width="20%">备品备件 </th></tr></thead>
                        <tbody>
                        <tr ng-repeat="r in reasons track by $index">
                            <td>{{r.name}}  </td>
                            <td style="text-align: left">{{r.solution}} </td>
                            <td style="text-align: left">{{r.tools}} </td>
                            <td style="text-align: left">{{r.parts}} </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="row text-left">
                    <h3>5、机组运行建议  </h3>
                    <table class="table">
                        <tbody>
                        <tr>
                            <td width="50%">紧急停机 </td>
                            <td width="50%"><input type="checkbox" ng-checked="fault.suggest=='紧急停机'"></td>
                        </tr>
                        <tr>
                            <td>监视运行  </td>
                            <td><input type="checkbox" ng-checked="fault.suggest=='监视运行'"></td>
                        </tr>
                        <tr>
                            <td>正常运行   </td>
                            <td><input type="checkbox" ng-checked="fault.suggest=='正常运行'"></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="report.js"></script>
</body>
</html>